<template>
  <div class="not-found">
    <div class="error-code">404</div>
    <h1>页面找不到了</h1>
    <button @click="goHome">返回首页</button>
  </div>
</template>

<script setup>
import { useRouter } from "vue-router";

const router = useRouter();

const goHome = () => {
  router.push("/"); 
};
</script>

<style scoped>
.not-found {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: #b895a7;
  color: #fff;
  text-align: center;
}

.error-code {
  font-size: 150px;
  font-weight: bold;
  margin-bottom: 20px;
}

h1 {
  font-size: 24px;
  margin-bottom: 20px;
}

button {
  width: 80px;
  height: 40px;
  background-color: #ffffff;
  color: #b895a7;
  border: none;
  border-radius: 5px;
  transition: all 0.3s ease;
}

button:hover {
  background-color: #f7d4e3;
  color: #fff;
}
</style>
